﻿using System.Globalization;

namespace uTILLIty.ADExtractor.Core.Formatters
{
	public class DateTimeFormatter : IFormatter
	{
		public string Format(string attributeName, object value, string valueSeparator)
		{
			var dateTimeValue = System.DateTime.FromFileTime((long)value);
			return dateTimeValue.ToString(CultureInfo.CurrentUICulture);
		}

		public bool CanFormat(string attributeName)
		{
			switch (attributeName.ToLowerInvariant())
			{
				case "lastlogon":
				case "pwdlastset":
					return true;
			}
			return false;
		}
	}
}